// SHPoint.h: interface for the SHPoint class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SHPOINT_H__8618A77D_5514_452D_87A2_7F22800A788F__INCLUDED_)
#define AFX_SHPOINT_H__8618A77D_5514_452D_87A2_7F22800A788F__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class AcDbHandle;
class JointPoint;
#include "ContainerModelPoint.h"
#include "SupportHangerPoint.h"
#include "afxtempl.h"
#include "SupportHanger.h"

class PartPoint;

class SHPoint : public ContainerModelPoint 
{

public:
	SHPoint();
	virtual ~SHPoint();
	
public:
	BOOL Create(const CString& strBlock, BOOL (*pGetMatrix)(AcGeMatrix3d& matrix) = NULL);
	
public:
	void RemoveSubPart(Part* pPart);
	void RemoveSubJoint(Joint* pJoint);

	BOOL WriteXData(){
		return WriteXData(EntityHandle());
	}

	virtual void Erase();
	virtual void UnErase();
	virtual void Update(BOOL bUpdate = FALSE);
	virtual void SetDicHandle(const Dictionary& handle);
	virtual AutoCADModelObserver& operator=(const AutoCADModelObserver& other);
	PartPoint FindObserver(Part* pPart);
	JointPoint FindObserver(Joint* pJoint);
private:
	PartPoint FindObserver(const CString &strName, Dictionary& dic);
	BOOL GetBasePt(AcGePoint3d& basePt);
	BOOL WriteXData(const AcDbHandle& id);
	BOOL GetObjectHandle(AcDbHandle& handle);
	void NewEntity();
	void UpdateSHPointEntity();
	void UpdateObserver();
	void UpdateModel();
	
	static const CString m_strSHJointManager;
	static const CString m_strSHPartManager;
};
#endif // !defined(AFX_SHPOINT_H__8618A77D_5514_452D_87A2_7F22800A788F__INCLUDED_)
